<!--
 * @Author: 花香蝶自来 1026583651@qq.com
 * @Date: 2024-04-16 18:35:31
 * @LastEditors: libing 964368540@qq.com
 * @LastEditTime: 2024-07-09 23:25:44
 * @FilePath: /crm/components/formz/components/formselect.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <view class="">
    <u-popup :show="showfalg" mode="right" width="500rpx">
      <u-navbar title="用户选择" :autoBack="false" @leftClick="popupback" />
      <view style="width: 750rpx">
        <u-list>
          <u-list-item v-for="(item, index) in list" :key="index">
            <u-cell :title="item.name" @click="tap(item)"> </u-cell>
          </u-list-item>
        </u-list>
      </view>
    </u-popup>
  </view>
</template>

<script>
import { getPageid } from "@/apis/customer/index";

export default {
  data() {
    return {
      showfalg: false,
      list: [],
      customContactsId: "",
      custom: "", // 客户名称
      customId: "",
      sysUserId: "",
      sysUserName: "", // 销售人员
    };
  },

  props: {},
  methods: {
    async show(item) {
      this.showfalg = true;
      this.custom = item.name;
      this.customId = item.id;
      this.sysUserId = item.sysUserId;
      this.sysUserName = item.sysUserName; // 销售人员
      let list = await getPageid({ id: item.id });

      this.list = [list];
    },
    popupback(e) {
      this.showfalg = false;
    },
    tap(item) {
      this.$emit("change", {
        ...item,
        custom: this.custom,
        customId: this.customId,
        sysUserId: this.sysUserId,
        sysUserName: this.sysUserName, // 销售人员
      });
      this.showfalg = false;
    },
  },
};
</script>

<style></style>
